<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>面向研究团队的参考文献管理与服务分布式系统</title>
<meta name="keywords" content="面向研究团队的参考文献管理与服务分布式系统" />
<meta name="description" content="面向研究团队的参考文献管理与服务分布式系统" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="../css/bootstrap.min.css" rel="stylesheet" />
<link href="../css/bootstrap-table.css" rel="stylesheet" />
<link href="../css/bootstrap-editable.css" rel="stylesheet" />
<link rel="stylesheet" href="../css/font-awesome.min.css" />
<link rel="stylesheet" href="../css/ace.min.css" />
<link rel="stylesheet" href="../css/ace-rtl.min.css" />
<link rel="stylesheet" href="../css/ace-skins.min.css" />
<script src="../js/ace-extra.min.js"></script>
<script src="../js/angular.min.js"></script>
<script src="../js/angular-cookies.min.js"></script>
</head>
<body>
	<div class="navbar navbar-default" id="navbar">
		<script type="text/javascript">
			try {
				ace.settings.check('navbar', 'fixed')
			} catch (e) {}
		</script>
		<div class="navbar-container" id="navbar-container">
			<div class="navbar-header pull-left">
				<a href="#" class="navbar-brand"> <small> <i
						class="icon-book"></i> 面向研究团队的参考文献管理与服务分布式系统
				</small>
				</a>
				<!-- /.brand -->
			</div>
			<!-- /.navbar-header -->
			<div class="navbar-header pull-right" role="navigation">
				<ul class="nav ace-nav">
					<li class="light-blue"><a data-toggle="dropdown" href="#"
						class="dropdown-toggle"> <img class="nav-user-photo"
							src="../avatars/user.jpg" alt="Jason's Photo" /> <span
							class="user-info"> <small>欢迎,</small> 登录
						</span> <i class="icon-caret-down"></i>
					</a>
						<ul
							class="user-menu pull-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
							<li><a href="#"> <i class="icon-cog"></i> 设置
							</a></li>
							<li><a href="#"> <i class="icon-user"></i> 简况
							</a></li>
							<li class="divider"></li>
							<li>
									<a href="/ma/user/logout"  class="a_post">
										<i class="icon-off"></i> 登出
									</a>
								</li>
						</ul></li>
				</ul>
				<!-- /.ace-nav -->
			</div>
			<!-- /.navbar-header -->
		</div>
		<!-- /.container -->
	</div>
	<div class="main-container" id="main-container">
		<script type="text/javascript">
			try {
				ace.settings.check('main-container', 'fixed')
			} catch (e) {}
		</script>
		<div class="main-container-inner">
			<a class="menu-toggler" id="menu-toggler" href="#"> <span
				class="menu-text"></span>
			</a>
			<div class="sidebar" id="sidebar">
				<script type="text/javascript">
					try {
						ace.settings.check('sidebar', 'fixed')
					} catch (e) {}
				</script>
				<!-- #sidebar-shortcuts -->
				<ul class="nav nav-list">
					<li id = "application"style="display: none;">
							<a href="/ma/admin/application.html">
								<i class="icon-legal"></i>
								<span class="menu-text">审核申请 </span>
							</a>
						</li>
						<li id = "singleUser"style="display: none;">
							<a href="/ma/admin/singleUser.html" >
								<i class="icon-leaf"></i>
								<span class="menu-text"> 独立用户 </span>
							</a>
						</li>
						
						<li id = "superAdminResearch"style="display: none;">
							<a href="/ma/admin/superAdminResearch.html">
								<i class="icon-group"></i>
								<span class="menu-text"> 研究团队 </span>
							</a>
						</li>
						<li id = "memberAdd"style="display: none;">
							<a href="/ma/admin/memberAdd.html">
								<i class="icon-group"></i>
								<span class="menu-text"> 添加成员 </span>
							</a>
						</li>

					<li><a href="email.html"> <i
							class="glyphicon glyphicon-envelope"></i> <span class="menu-text">
								邮件系统 </span>
					</a></li>
					<li><a href="message.html"> <i
							class="glyphicon glyphicon-comment"></i> <span class="menu-text">
								短信系统 </span>
					</a></li>
					<li><a href="professionalCode.html"> <i
							class="glyphicon glyphicon-th-list"></i> <span class="menu-text">
								专业分类 </span>
					</a></li>
					<li id="city"><a href="city.html"> <i class="icon-globe"></i> <span
							class="menu-text"> 地区城市 </span>
					</a></li>
					<li><a href="#" class="dropdown-toggle"> <i
							class="glyphicon glyphicon-tasks"></i> <span class="menu-text">组织机构</span>
							<b class="arrow icon-angle-down"></b>
					</a>
						<ul class="submenu">
							<li><a href="#" class="dropdown-toggle"> <i
									class="icon-leaf"></i> 出版商 <b class="arrow icon-angle-down"></b>
							</a>
								<ul class="submenu">
									<li><a href="publisher1.html"> <i class="icon-plus"></i>
											国外出版商
									</a></li>
									<li><a href="publisher2.html"> <i
											class="icon-eye-open"></i> 国内出版商
									</a></li>
								</ul></li>
							<li><a href="#" class="dropdown-toggle"> <i
									class="icon-leaf"></i> 大学 <b class="arrow icon-angle-down"></b>
							</a>
								<ul class="submenu">
									<li><a href="institution1.html"> <i class="icon-plus"></i>
											国外大学
									</a></li>
									<li><a href="institution2.html"> <i
											class="icon-eye-open"></i> 国内大学
									</a></li>
								</ul></li>
							<li><a href="#" class="dropdown-toggle"> <i
									class="icon-pencil"></i> 其他机构 <b class="arrow icon-angle-down"></b>
							</a>
								<ul class="submenu">
									<li><a href="#"> <i class="icon-plus"></i> 国外其他机构
									</a></li>
									<li><a href="#"> <i class="icon-eye-open"></i> 国内其他机构
									</a></li>
								</ul></li>
						</ul></li>
					<li class="active"><a href="profile.html"> <i
							class="glyphicon glyphicon-user"></i> <span class="menu-text">
								个人信息 </span>
					</a></li>
					
				</ul>
				<!-- /.nav-list -->
				<div class="sidebar-collapse" id="sidebar-collapse">
					<i class="icon-double-angle-left"
						data-icon1="icon-double-angle-left"
						data-icon2="icon-double-angle-right"></i>
				</div>
				<script type="text/javascript">
					try {
						ace.settings.check('sidebar', 'collapsed')
					} catch (e) {}
				</script>
			</div>
			<div class="main-content">
				<div class="breadcrumbs" id="breadcrumbs">
					<script type="text/javascript">
						try {
							ace.settings.check('breadcrumbs', 'fixed')
						} catch (e) {}
					</script>
					<ul class="breadcrumb">
						<li><i class="icon-home home-icon"></i> <a href="#">主页</a></li>
						<li class="active">个人信息</li>
					</ul>
					<!-- .breadcrumb -->
					<!-- #nav-search -->
				</div>
				<div class="page-content">
					<div class="row">
						<div class="col-xs-12">
							<!-- PAGE CONTENT BEGINS -->
							<div class="row">
								<div class="col-xs-12">
									<div ng-app="myApp" ng-controller="myCtrl" id="user-profile-1"
										class="user-profile row">
										<div class="col-xs-12 col-sm-6">
											<div class="profile-user-info profile-user-info-striped">
                                                <div class="profile-info-row">
                                                    <div class="profile-info-name">用户号</div>
                                                    <div class="profile-info-value">
                                                        <input type="text" id="userNo" ng-model="userNo"
                                                               style="border:0px;color:#000000" disabled="disabled" />
                                                        <!-- <span class="editable editable-click" id="age">{{ userTeamNo }}</span> -->
                                                    </div>
                                                </div>
												<div class="profile-info-row">
													<div class="profile-info-name">团队名称</div>
													<div class="profile-info-value">
														<input type="text" id="userTeamName" ng-model="teamName"
															style="border:0px;color:#000000" disabled="disabled" />
														<!-- <span class="editable editable-click" id="age">{{ userTeamNo }}</span> -->
													</div>
												</div>
												<div class="profile-info-row">
													<div class="profile-info-name">用户角色</div>
													<div class="profile-info-value">
														<input type="text" id="userRole" ng-model="userRole"
															style="border:0px;color:#000000" disabled="disabled" />
														<!-- <span class="editable editable-click" id="age">{{ userRole }}</span> -->
													</div>
												</div>
												<div class="profile-info-row">
													<div class="profile-info-name">用户团队号</div>

													<div class="profile-info-value">
														<input type="text" id="userTeamNo" ng-model="userTeamNo"
															style="border:0px;color:#000000" disabled="disabled" />
														<!-- <span class="editable editable-click" id="age">{{ userTeamNo }}</span> -->
													</div>
												</div>
											</div>
										</div>
										<div class="col-xs-12 col-sm-6">
											<!-- <div class="space-12"></div> -->
											<div class="profile-user-info profile-user-info-striped">
                                                <div class="profile-info-row">
                                                    <div class="profile-info-name">用户名</div>
                                                    <div class="profile-info-value">
                                                        <input type="text" id="userName" ng-model="userName"
                                                               style="border:0px;color:#000000"  readonly/>
                                                        <!-- <span class="editable editable-click" id="country">{{ userName }}</span> -->
                                                    </div>
                                                </div>
												<div class="profile-info-row">
													<div class="profile-info-name">身份证号</div>
													<div class="profile-info-value">
														<input type="text" id="iDNo" ng-model="iDNo"
															style="border:0px;color:#000000" readonly/>
													</div>
												</div>

												<div class="profile-info-row">
													<div class="profile-info-name">联系电话</div>

													<div class="profile-info-value">
														<input type="text" id="userPhone" ng-model="userPhone"
															style="border:0px;color:#000000" readonly/>
														<!-- <span ng-model="userPhone" class="editable editable-click" id="login">{{ userPhone }}</span> -->
													</div>
												</div>
												<div class="profile-info-row">
													<div class="profile-info-name">Email</div>

													<div class="profile-info-value">
														<input type="text" id="userEmail" ng-model="userEmail"
															style="border:0px;color:#000000" readonly />
														<!-- <span class="editable editable-click" id="about">{{ userEmail }}</span> -->
													</div>
												</div>
<!--												<div class="profile-info-row">-->
<!--													<div class="profile-info-name">密码</div>-->
<!--													<div class="profile-info-value">-->
<!--														<input type="text" id="password" ng-model="password"-->
<!--															style="border:0px;color:#000000" readOnly />-->
<!--														&lt;!&ndash; <span class="editable editable-click" id="about">{{ userEmail }}</span> &ndash;&gt;-->
<!--													</div>-->
<!--												</div>-->
												<div class="profile-info-row">
													<div class="profile-info-name">备注</div>

													<div class="profile-info-value">
														<input type="text" id="note" ng-model="note"
															style="border:0px;color:#000000" readonly/>
														<!-- <span class="editable editable-click" id="about">{{ note }}</span> -->
													</div>
												</div>
											</div>
											<div class="space-20"></div>
										</div>
									</div>
								</div>
								<div class="profile-contact-info">
									<div class="profile-contact-links align-center">
										<input class="btn btn-primary" id="update" value="编辑"
											type="submit" style="width: auto;"> <input
											class="btn btn-primary" id="submit" value="修改" type="submit"
											style="width: auto;">
									</div>
									<div class="space-6"></div>
								</div>
							</div>
							<!-- PAGE CONTENT ENDS -->
						</div>
						<!-- /.col -->
					</div>
					<!-- /.row -->
				</div>
				<!-- /.page-content -->
			</div>
			<!-- /.main-content -->
			<div class="ace-settings-container" id="ace-settings-container">
				<div class="btn btn-app btn-xs btn-warning ace-settings-btn"
					id="ace-settings-btn">
					<i class="icon-cog bigger-150"></i>
				</div>
				<div class="ace-settings-box" id="ace-settings-box">
					<div>
						<div class="pull-left">
							<select id="skin-colorpicker" class="hide">
								<option data-skin="default" value="#438EB9">#438EB9</option>
								<option data-skin="skin-1" value="#222A2D">#222A2D</option>
								<option data-skin="skin-2" value="#C6487E">#C6487E</option>
								<option data-skin="skin-3" value="#D0D0D0">#D0D0D0</option>
							</select>
						</div>
						<span>&nbsp; 换肤</span>
					</div>
					<div>
						<input type="checkbox" class="ace ace-checkbox-2"
							id="ace-settings-add-container" /> <label class="lbl"
							for="ace-settings-add-container"> 居中 <b></b>
						</label>
					</div>
				</div>
			</div>
			<!-- /#ace-settings-container -->
		</div>
		<!-- /.main-container-inner -->
		<a href="#" id="btn-scroll-up"
			class="btn-scroll-up btn btn-sm btn-inverse"> <i
			class="icon-double-angle-up icon-only bigger-110"></i>
		</a>
	</div>
	<script src="../js/jquery-2.0.3.min.js"></script>
	<script src="../js/jquery.cookie.js"></script>
	<script src="../js/bootstrap.min.js"></script>
	<script type="text/javascript">
		if ("ontouchend" in document) document.write("<script src='../js/jquery.mobile.custom.min.js'>" + "<" + "/script>");
	</script>
	<script src="../js/bootstrap.min.js"></script>
	<script src="../js/bootstrap-table.js"></script>
	<script src="../js/bootstrap-editable.js"></script>
	<script src="../js/bootstrap-table-zh-CN.js"></script>
	<script src="../js/typeahead-bs2.min.js"></script>
	<script src="../js/ace-elements.min.js"></script>
	<script src="../js/ace.min.js"></script>
	<script src="/ma/mainjs/auth.js"></script>

		<script>
			$(function () {
			    judgeAuthority();
			})
		var app = angular.module('myApp', []);
		app.controller('myCtrl', function($scope, $http) {//将用户的个人信息在文本框中显示出来
		// 	$http({
		// 		method : 'POST',
		// 		data : 'json',
		// 		url : '/ma/user/getSession'
		// 	}).then(function successCallback(response) {
		// 		console.log(response.data)
		// 		var user = response.data
		// 		var team = response.data
		// 		$scope.userNo = user.userNo;
		// 		$scope.password = user.password;
		// 		$scope.userName = user.userName;
		// 		$scope.userTeamNo = user.userTeamNo;
		// 		$scope.iDNo = user.iDNo;
		// 		$scope.userPhone = user.userPhone;
		// 		$scope.userEmail = user.userEmail;
		// 		$scope.userRole = user.userRole;
		// 		$scope.note = user.note;
		// 	}, function errorCallback(response) { // 请求失败执行代码
		// 		alert("无法读取个人信息！");
		// 	});
		// });
            $http({
                method : 'POST',
                data : 'json',
                url : '/ma/user/getUserAndTeam'
            }).then(function successCallback(response) {
                console.log(response.data)
                var user = response.data.data
                $scope.userNo = user.userNo;
				$scope.teamName = user.teamName;
				$scope.userRole = user.userRoleName;
				$scope.userTeamNo = user.teamNo;
                $scope.userName = user.userName;
                $scope.iDNo = user.iDNo;
                $scope.userPhone = user.userPhone;
                $scope.userEmail = user.userEmail;
                $scope.note = user.note;
            }, function errorCallback(response) { // 请求失败执行代码
                alert("无法读取个人信息！");
            });
        });
		$('#update').click(function(e) { //实现个人信息开始编辑
			$('#userName').attr("readOnly", false); //使个人信息文本框“只读”控制失效，可以编辑
			$('#iDNo').attr("readOnly", false);
			$('#userPhone').attr("readOnly", false);
			$('#userEmail').attr("readOnly", false);
			$('#note').attr("readOnly", false);
			alert("请在信息栏中进行编辑"); //提醒用户可以开始编辑
		});
		$('#submit').click(function(e) { //点击编辑按钮后实现个人信息保存功能
			$('#userName').attr("readOnly", true); //使个人信息文本框“只读”控制生效，无法编辑
			$('#iDNo').attr("readOnly", true);
			$('#userPhone').attr("readOnly", true);
			$('#userEmail').attr("readOnly", true);
			$('#note').attr("readOnly", true);
			$('#password').attr("readOnly", true);

			var userNo = $("#userNo").val();

			var userName = $("#userName").val();
			var iDNo = $("#iDNo").val();
			var userPhone = $("#userPhone").val();
			var userEmail = $("#userEmail").val();
			var note = $("#note").val();

			$.ajax({
				type : "Post",
				contentType : "application/json",
				data :JSON.stringify({
					"userNo" : userNo,
					"userName" : userName,
					"iDNo" : iDNo,
					"userPhone" : userPhone,
					"userEmail" : userEmail,
					"note" : note,
				}),
				dataType : 'json',
				url : '/ma/user/update',
				success : function(data) {
					alert("修改成功！"); //提醒用户保存修改信息成功
				},
				error : function() {
					alert("修改失败！"); //提醒用户保存修改信息失败
				}
			});
		});
	</script>
</body>
</html>